// Copyright (c) 2016, SolidCP
// SolidCP is distributed under the Creative Commons Share-alike license
// 
// SolidCP is a fork of WebsitePanel:
// Copyright (c) 2015, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must  retain  the  above copyright notice, this
//   list of conditions and the following disclaimer.
//
// - Redistributions in binary form  must  reproduce the  above  copyright  notice,
//   this list of conditions  and  the  following  disclaimer in  the documentation
//   and/or other materials provided with the distribution.
//
// - Neither  the  name  of  the  Outercurve Foundation  nor   the   names  of  its
//   contributors may be used to endorse or  promote  products  derived  from  this
//   software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,  BUT  NOT  LIMITED TO, THE IMPLIED
// WARRANTIES  OF  MERCHANTABILITY   AND  FITNESS  FOR  A  PARTICULAR  PURPOSE  ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL,  SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO,  PROCUREMENT  OF  SUBSTITUTE  GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)  HOWEVER  CAUSED AND ON
// ANY  THEORY  OF  LIABILITY,  WHETHER  IN  CONTRACT,  STRICT  LIABILITY,  OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE)  ARISING  IN  ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.1433
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

// 
// This source code was auto-generated by wsdl, Version=2.0.50727.42.
// 
using SolidCP.Providers.Common;

namespace SolidCP.AutoDiscovery
{
    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Web.Services.WebServiceBindingAttribute(Name = "AutoDiscoverySoap", Namespace = "http://tempuri.org/")]
    [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResultObject))]
    public partial class AutoDiscovery : Microsoft.Web.Services3.WebServicesClientProtocol
    {

        private System.Threading.SendOrPostCallback IsInstalledOperationCompleted;

        private System.Threading.SendOrPostCallback GetServerVersionOperationCompleted;

        private System.Threading.SendOrPostCallback GetServerFilePathOperationCompleted;

        /// <remarks/>
        public AutoDiscovery()
        {
            this.Url = "http://192.168.0.13:8080/Server/AutoDiscovery.asmx";
        }

        /// <remarks/>
        public event IsInstalledCompletedEventHandler IsInstalledCompleted;

        /// <remarks/>
        public event GetServerVersionCompletedEventHandler GetServerVersionCompleted;

        /// <remarks/>
        public event GetServerFilePathCompletedEventHandler GetServerFilePathCompleted;


        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/IsInstalled", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public BoolResult IsInstalled(string providerName)
        {
            object[] results = this.Invoke("IsInstalled", new object[] {
                    providerName});
            return ((BoolResult)(results[0]));
        }

        /// <remarks/>
        public System.IAsyncResult BeginIsInstalled(string providerName, System.AsyncCallback callback, object asyncState)
        {
            return this.BeginInvoke("IsInstalled", new object[] {
                    providerName}, callback, asyncState);
        }

        /// <remarks/>
        public BoolResult EndIsInstalled(System.IAsyncResult asyncResult)
        {
            object[] results = this.EndInvoke(asyncResult);
            return ((BoolResult)(results[0]));
        }

        /// <remarks/>
        public void IsInstalledAsync(string providerName)
        {
            this.IsInstalledAsync(providerName, null);
        }

        /// <remarks/>
        public void IsInstalledAsync(string providerName, object userState)
        {
            if ((this.IsInstalledOperationCompleted == null))
            {
                this.IsInstalledOperationCompleted = new System.Threading.SendOrPostCallback(this.OnIsInstalledOperationCompleted);
            }
            this.InvokeAsync("IsInstalled", new object[] {
                    providerName}, this.IsInstalledOperationCompleted, userState);
        }

        private void OnIsInstalledOperationCompleted(object arg)
        {
            if ((this.IsInstalledCompleted != null))
            {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.IsInstalledCompleted(this, new IsInstalledCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }

        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetServerVersion", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public string GetServerVersion()
        {
            object[] results = this.Invoke("GetServerVersion", new object[0]);
            return ((string)(results[0]));
        }

        /// <remarks/>
        public System.IAsyncResult BeginGetServerVersion(System.AsyncCallback callback, object asyncState)
        {
            return this.BeginInvoke("GetServerVersion", new object[0], callback, asyncState);
        }

        /// <remarks/>
        public string EndGetServerVersion(System.IAsyncResult asyncResult)
        {
            object[] results = this.EndInvoke(asyncResult);
            return ((string)(results[0]));
        }

        /// <remarks/>
        public void GetServerVersionAsync()
        {
            this.GetServerVersionAsync(null);
        }

        /// <remarks/>
        public void GetServerVersionAsync(object userState)
        {
            if ((this.GetServerVersionOperationCompleted == null))
            {
                this.GetServerVersionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetServerVersionOperationCompleted);
            }
            this.InvokeAsync("GetServerVersion", new object[0], this.GetServerVersionOperationCompleted, userState);
        }

        private void OnGetServerVersionOperationCompleted(object arg)
        {
            if ((this.GetServerVersionCompleted != null))
            {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetServerVersionCompleted(this, new GetServerVersionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }


        /// <remarks/>
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetServerFilePath", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        public string GetServerFilePath() {
            object[] results = this.Invoke("GetServerFilePath", new object[0]);
            return ((string)(results[0]));
        }

        /// <remarks/>
        public System.IAsyncResult BeginGetServerFilePath(System.AsyncCallback callback, object asyncState) {
            return this.BeginInvoke("GetServerFilePath", new object[0], callback, asyncState);
        }

        /// <remarks/>
        public string EndGetServerFilePath(System.IAsyncResult asyncResult) {
            object[] results = this.EndInvoke(asyncResult);
            return ((string)(results[0]));
        }

        /// <remarks/>
        public void GetServerFilePathAsync() {
            this.GetServerFilePathAsync(null);
        }

        /// <remarks/>
        public void GetServerFilePathAsync(object userState) {
            if((this.GetServerFilePathOperationCompleted == null)) {
                this.GetServerFilePathOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetServerFilePathOperationCompleted);
            }
            this.InvokeAsync("GetServerFilePath", new object[0], this.GetServerFilePathOperationCompleted, userState);
        }

        private void OnGetServerFilePathOperationCompleted(object arg) {
            if((this.GetServerFilePathCompleted != null)) {
                System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
                this.GetServerFilePathCompleted(this, new GetServerFilePathCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
            }
        }

        /// <remarks/>
        public new void CancelAsync(object userState)
        {
            base.CancelAsync(userState);
        }
    }




    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void IsInstalledCompletedEventHandler(object sender, IsInstalledCompletedEventArgs e);

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class IsInstalledCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
    {

        private object[] results;

        internal IsInstalledCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
            base(exception, cancelled, userState)
        {
            this.results = results;
        }

        /// <remarks/>
        public BoolResult Result
        {
            get
            {
                this.RaiseExceptionIfNecessary();
                return ((BoolResult)(this.results[0]));
            }
        }
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void GetServerVersionCompletedEventHandler(object sender, GetServerVersionCompletedEventArgs e);

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetServerVersionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
    {

        private object[] results;

        internal GetServerVersionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
            base(exception, cancelled, userState)
        {
            this.results = results;
        }

        /// <remarks/>
        public string Result
        {
            get
            {
                this.RaiseExceptionIfNecessary();
                return ((string)(this.results[0]));
            }
        }
    }


    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    public delegate void GetServerFilePathCompletedEventHandler(object sender, GetServerFilePathCompletedEventArgs e);

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    public partial class GetServerFilePathCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {

        private object[] results;

        internal GetServerFilePathCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
            base(exception, cancelled, userState) {
            this.results = results;
        }

        /// <remarks/>
        public string Result {
            get {
                this.RaiseExceptionIfNecessary();
                return ((string)(this.results[0]));
            }
        }
    }
}
